<!--
 * @Author: HeAo
 * @Date: 2022-07-26 10:54:29
 * @LastEditTime: 2022-08-30 16:57:52
 * @LastEditors: HeAo
 * @Description: 
 * @FilePath: \HTML5&CSS3\第八天\6-order.html
 * 别乱动！
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    /* 父元素 */
    .container {
      width: 400px;
      height: 300px;
      margin: 0 auto;
      background-color: lemonchiffon;
      /* 容器属性-设置给父元素 */
      /* 开启弹性盒布局 
      弹性元素沿着主轴方向排列
      */
      display: flex;
    }

    /* 子元素 */
    .container div {
      width: 60px;
      height: 50px;
      color: white;
    }


    /* 控制元素排列顺序 值越小越靠前 order默认为0 */
    .div3 {
      order: 3;
    }

    .div2 {
      order: 2;
    }

    .div1 {
      order: 1;
    }
  </style>
</head>

<body>
  <div class="container">
    <div class="div1" style="background-color:red;">弹性元素div1</div>
    <div class="div2" style="background-color:blue;">弹性元素div2</div>
    <div class="div3" style="background-color:green;">弹性元素div3</div>
  </div>

</body>

</html>